<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=utf-8"%> 
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="css/moban.css" type="text/css" rel="stylesheet" media="screen" />
    <link href="css/widget.css" type="text/css" rel="stylesheet" media="screen" />
    <link href="css/table.css" type="text/css" rel="stylesheet" media="screen" />
    <link href="./managementOfMember/css/btn.css" type="text/css" rel="stylesheet" media="screen" />
    <script type="text/javascript" src="./managementOfMember/js/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
     
    <script type="text/javascript">
    	function check(i){
    		document.getElementById("checkcondition").value = i;
    	}
    	function showMsg() {
    		var msg = '${message}';
    		if(msg!=null&&msg!=""){
    			alert(msg);
    		}
    	}
    	function changeMajors(){
    		document.getElementById("major").options.length =0;
    		var department = $("#department").val();
    		
    		$("#major").load("majorOptionsAction",{department:department});
    	} 
    	function changeSrc(obj){
    		obj.src="img/return2.png";
    	}
    	function changeSrc2(obj){
    		obj.src="img/return.png";
    	}
    </script>
    
</head>
  
<body onload="showMsg()">

<div style="background-color:#2E5E79;width:100%;height:50px;position:fixed;top:0;left:0;"></div>
<div id="package">
	<div id="hel">
		<div id="title">
    		<span><img src="./managementOfMember/images/home.png" /> &nbsp;填写信息</span>
    		<span id="right"><a href="managementOfMember/importSutdentInfoByHand.jsp" target="main">
			<img src="img/return.png" onMouseOver="changeSrc(this)" onMouseOut="changeSrc2(this)">
			</a></span>
    	</div>
    </div>
	<div id="content"style="padding-bottom:50px;">
	<form action="executeimportStudentInfoByHand.action" method="post">
    	<table>
    		<tr>
    			<th colspan="2" style="text-align:center;">
    				<s:iterator value="#session.stages" var="stage">
				    	<s:if test="#stage.id == process">
				    		<b style="font-size:24px;"><s:property value="#stage.name"/>阶段</b>
				    	</s:if>
				    </s:iterator>
    			</th>
    		</tr>
	  		<input type="text" id="checkcondition" name="checkcondition" value=""  style="display:none;"/>
	  		<input type="text" name="process" value="<s:property value="process"/>"  style="display:none;"/>
	  		<!-- 老团员时 -->
	  			<s:if test="process == -1">
	  				<s:iterator value="#session.fields" var="field">
		    			<s:if test="#field.stage <= 4 && #field.stage > 0">
		    				<s:if test="#field.name != 'age'">
		    					<tr >
		    						<td>
				    					<s:property value="#field.chinese"/>：
				    				</td>
				    				<td>
				    					<s:if test="#field.name == 'sex'">
				    						<input name="sex" type="radio" value="男" />男
				    						<input name="sex" type="radio" value="女" />女
				    					</s:if>
				    					<s:elseif test="#field.name == 'department'">
				    						<select name="department" id="department" onchange="changeMajors()"> 
				    							<option value="请选择">请选择</option>
				    							<s:iterator value="#departments" var="department">
				    								<option value="<s:property value="#department.getName()"/>"><s:property value="#department.getName()"/></option> 
				    							</s:iterator>
											</select> 
				    					</s:elseif>
				    					
				    					<s:elseif test="#field.name == 'major'">
				    						<select name="major" id="major"> 
				    						   
											</select> 
				    					</s:elseif>
				    					
				    					<s:elseif test="#field.name == 'birthday' || #field.name == 'jointime' || #field.name == 'gradetime'">
				    						<input class="Wdate" type="text" onClick="WdatePicker()" name="<s:property value="#field.name"/>">
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'nationality'">
				    						<input type="text" name="nationality" value="汉" class="in"/>
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'application' || #field.name == 'membercard'">
				    						<input name="<s:property value="#field.name"/>" type="radio" value="有" />有
				    						<input name="<s:property value="#field.name"/>" type="radio" value="无" />无
				    					</s:elseif>
				    					<s:else>
				    						<s:if test="#field.defaultValue != null">
				    							<select name="<s:property value="#field.name"/>"> 
													<option value="<s:property value="#field.defaultValue"/>"><s:property value="#field.defaultValue"/></option> 
												</select> 
				    						</s:if>
				    						<s:else>
					    						<input type="text" name="<s:property value="#field.name"/>" class="in" />
					    					</s:else>
				    					</s:else>
				    				</td>
			    				</tr>	
		    				</s:if>
		    			</s:if>
		    		</s:iterator>
	  			</s:if>
		    	<s:elseif test="process == 1">
		    		<s:iterator value="#session.fields" var="field">
		    			<s:if test="#field.stage == process">
		    				<s:if test="#field.name != 'age'">
		    					<tr style="height:40px">
		    						<td><s:property value="#field.chinese"/>：</td>
					    			<td>
					    				<s:if test="#field.name == 'sex'">
				    						<input name="sex" type="radio" value="男" />男
				    						<input name="sex" type="radio" value="女" />女
				    					</s:if>
				    					<s:elseif test="#field.name == 'department'">
				    						<select name="department" id="department" onchange="changeMajors()"> 
				    							<option value="请选择">请选择</option>
				    							<s:iterator value="#request.departments" var="department">
				    								<option value="<s:property value="#department.getName()"/>"><s:property value="#department.getName()"/></option> 
				    							</s:iterator>
											</select> 
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'major'">
				    						<select name="major" id="major"> 
				    						   <option>请选择</option>
				    						
											</select> 
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'birthday' || #field.name == 'jointime' || #field.name == 'gradetime'">
				    						<input class="Wdate" type="text" onClick="WdatePicker()" name="<s:property value="#field.name"/>">
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'nationality'">
				    						<input type="text" name="nationality" value="汉" class="in"/>
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'application' || #field.name == 'membercard'">
				    						<input name="<s:property value="#field.name"/>" type="radio" value="有" />有
				    						<input name="<s:property value="#field.name"/>" type="radio" value="无" />无
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'memberclass'">
				    						<select name="memberclass"> 
												<option value="旷课">旷课</option> 
												<option value="请假">请假</option> 
												<option value="完成">完成</option> 
											</select> 
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'volunteer'">
				    						<select name="volunteer"> 
												<option value="1次">1次</option> 
												<option value="2次">2次</option> 
												<option value="3次（完成）">3次（完成）</option> 
												<option value="4次（完成）">4次（完成）</option> 
												<option value="5次（完成）">5次（完成）</option> 
												<option value="6次（完成）">6次（完成）</option> 
												<option value="7次（完成）">7次（完成）</option> 
												<option value="8次（完成）">8次（完成）</option> 
												<option value="9次（完成）">9次（完成）</option> 
											</select> 
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'grade'">
				    						<select name="grade"> 
												<option value="通过">通过</option> 
												<option value="未通过">未通过</option> 
											</select> 
				    					</s:elseif>
				    					<s:else>
				    						<input type="text" name="<s:property value="#field.name"/>" class="in" />
				    					</s:else>
					    			</td>
			    				</tr>
			    			</s:if>
		    			</s:if>
		    		</s:iterator>
		    	</s:elseif>
		    	<s:else>
		    		<tr style="height:40px">
		    			<td>身份证号：</td>
		    			<td><input type="text" name="idcard" class="in">（必填且已存在）</td>
		    		</tr>
		    		<tr style="height:40px">
		    			<td>姓名：</td>
		    			<td><input type="text" name="name" class="in">（必填且已存在）</td>
		    		</tr>
		    		<tr style="height:40px">
		    			<td>团总支：</td>
		    			<td>
							<select name="department" id="department" onchange="changeMajors()"> 
								<option value="请选择">请选择</option>
				    			<s:iterator value="#request.departments" var="department">
				    				<option value="<s:property value="#department.getName()"/>"><s:property value="#department.getName()"/></option> 
				    			</s:iterator>
							</select> 
						</td>
		    		</tr>
		    		<tr style="height:40px">
		    			<td>团支部：</td>
		    			<td>
		    				<select name="major" id="major"> 
							</select>
						</td>
		    		</tr>
		    		<s:iterator value="#session.fields" var="field">
		    			<s:if test="#field.stage == process">
		    				<s:if test="#field.stage == process">
		    					<tr style="height:40px">
				    				<td><s:property value="#field.chinese"/>：</td>
					    			<td>
					    				<s:if test="#field.name == 'sex'">
				    						<input name="sex" type="radio" value="男" />男
				    						<input name="sex" type="radio" value="女" />女
				    					</s:if>
				    					<s:elseif test="#field.name == 'department'">
				    						<select name="department"> 
				    							<s:iterator value="#departments" var="department" id="department">
				    								<option value="<s:property value="#department.getName()"/>"><s:property value="#department.getName()"/></option> 
				    							</s:iterator>
											</select> 
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'major'">
				    						<select name="major" id="major"> 
											</select> 
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'birthday' || #field.name == 'jointime' || #field.name == 'gradetime'">
				    						<input class="Wdate" type="text" onClick="WdatePicker()" name="<s:property value="#field.name"/>">
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'nationality'">
				    						<input type="text" name="nationality" value="汉" class="in"/>
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'application' || #field.name == 'membercard'">
				    						<input name="<s:property value="#field.name"/>" type="radio" value="有" />有
				    						<input name="<s:property value="#field.name"/>" type="radio" value="无" />无
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'memberclass'">
				    						<select name="memberclass"> 
												<option value="旷课">旷课</option> 
												<option value="请假">请假</option> 
												<option value="完成">完成</option>
												<option value="1次（完成）">1次（完成）</option>
												<option value="2次（完成）">2次（完成）</option>
												<option value="3次（完成）">3次（完成）</option> 
												<option value="4次（完成）">4次（完成）</option> 
												<option value="5次（完成）">5次（完成）</option> 
												<option value="6次（完成）">6次（完成）</option> 
												<option value="7次（完成）">7次（完成）</option> 
												<option value="8次（完成）">8次（完成）</option> 
												<option value="9次（完成）">9次（完成）</option>   
											</select> 
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'volunteer'">
				    						<select name="volunteer"> 
				    						<option value="完成">完成</option>
				    						<option value="未完成）">未完成</option>
				    						<s:bean name="org.apache.struts2.util.Counter" id="counter">
											<s:param name="first" value="1" />											
											<s:param name="last" value="99" />
				    							<s:iterator>
												<option value="<s:property value="current-1"/>次"><s:property value="current-1"/>次</option> 
												</s:iterator>
												</s:bean>
											</select> 
				    					</s:elseif>
				    					<s:elseif test="#field.name == 'grade'">
				    						<select name="grade"> 
												<option value="通过">通过</option> 
												<option value="未通过">未通过</option> 
											</select> 
				    					</s:elseif>
				    					<s:else>
				    						<input type="text" name="<s:property value="#field.name"/>" class="in" />
				    					</s:else>
					    			</td>
				    			</tr>
		    				</s:if>
		    			</s:if>
		    		</s:iterator>
		    	</s:else>
		    	<tr style="height:40px;">
		    		<td style="text-align:center;">
		    			<input type="submit" value="提交" onclick="check(1)" class="className"/>
		    			<!-- <input type="submit" value="暂存" onclick="check(0)" class="className"/> -->
		    		</td>
		    		<td>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重置" class="className" /></td>
		    	</tr>
	    	
	  	</table>
	  	</form>
    </div>
</div> 

</body>
</html>
